package demo;

import java.awt.Color;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;

import eventhandle.MyWindowEventHandle2;


public class BorderLayoutDemo3 {

	public static void main(String[] args) {
		JFrame frame = new JFrame("Welcome To MLDN") ;	// 实例化窗体对象
		// 此时直接使用WindowAdapter的子类完成监听的处理
		frame.addWindowListener(new MyWindowEventHandle2());
		frame.setSize(300, 160) ;				// 设置组件大小
		frame.setBackground(Color.WHITE) ;			// 设置窗体的背景颜色
		frame.setLocation(300,200) ;			// 设置窗体的显示位置
		frame.setVisible(true) ;
		/*frame.addWindowListener(new WindowAdapter() {
			@Override
			public void windowClosed(WindowEvent e) {
				System.exit(-1);
			}
		});*/
	}

}
